home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 2
/
Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso
/
Aminet
/
gfx
/
conv
/
hp2xx_1_04.lha
/
hp2xx.asc
< prev
next >
Wrap
Text File
|
1992-09-24
|
13KB
|
331 lines
hp2xx(1) USER COMMANDS hp2xx(1)
NAME
hp2xx - A HPGL converter into some vector- and raster for-
mats
USAGE
hp2xx [-options] [hpgl-file(s)]
OPTION SUMMARY
Option Format Default Description
-------------------------------------------------------------------------
General options:
-f char * "" Name of output file (default: stdout)
-m char * pcl Mode. Valid: mf,ps, pcl,pcx,atari, vga (DOS only)
-p int 1 Pensize [dots] (PCL,PCX,VGA), [1/10 mm] (mf, ps).
Valid: 1-4
-q off Quiet mode. No diagnostic output.
-r double 0.0 Rotation angle [deg]. -r90 gives landscape
-s char * hp2xx.swp Name of swap file
Size controls:
-a double 1.0 Aspect factor. Valid: > 0.0
-h double 100 Height [mm] of picture
-w double - Width [mm] of picture. If given, overrides -h
-x double - Preset xmin value of HPGL coordinate range
-X double - Preset xmax value of HPGL coordinate range
-y double - Preset ymin value of HPGL coordinate range
-Y double - Preset ymax value of HPGL coordinate range
Raster format controls:
-d int 75 DPI value (x or both x&y)
-D int 75 DPI value (y only)
PCL only:
-F off Send a FormFeed after graphics data
-i off Pre-initialize printer
-S off Use (Deskjet) Special commands
-o double 0.0 x offset [mm] of picture (left margin)
-O double 0.0 y offset [mm] of picture (upper margin)
-d (see above) Valid ONLY 300, 150, 100, 75
-D (see above) INVALID for PCL!
PS and PCL:
-o double 0.0 x offset [mm] of picture (left margin)
-O double 0.0 y offset [mm] of picture (upper margin)
VGA (on PCs) only: Hi-Res mode setups:
-V int 18 VGA mode byte (decimal)
-W int 640 VGA pixel width.
-------------------------------------------------------------------------
-H Show help.
Sun Release 4.1 Last change: 12 September 1991 1
hp2xx(1) USER COMMANDS hp2xx(1)
DESCRIPTION
_h_p_2_x_x reads HPGL ASCII source files, interprets them, and
converts them into either another vector-oriented format or
one of several rasterfile formats. Currently, its HPGL
parser only recognizes a small subset of the HP 7475 command
subset, basically the absolute or relative Move or Draw com-
mands, so don't expect fancier stuff like circles / text
output / filled polygons. Since it only processes simple
vectors, its output can be easily adapted to many formats.
GENERAL FUNCTION
_h_p_2_x_x reads from stdin or from a file if any given on the
command line. You may specify more than one input file (if
this makes sense at all). The output is written to stdout by
default. Use option -_f _o_u_t_f_i_l_e to specify your output file
name, or just use output redirection (DOS users beware: DOS
limits output redirection to ASCII data only, so -f is pre-
ferred). The program scans the current HPGL source, writes
all vectors in internal binary format into a temporary file,
and concurrently determines the maximal coordinate range. It
then processes the vectors by mapping them into a new coor-
dinate system with a height of 100mm by default exactly cov-
ering the detected y range, and by preserving the aspect
ratio of the original data. Use option -_h _h_e_i_g_h_t to set the
desired height of your output picture; optionally use -_a
_a_s_p_e_c_t_f_a_c_t_o_r to alter the aspect ratio by the given factor
(aspectfactor < 1 narrows your picture). Alternatively,
specify the desired picture width using -_w _w_i_d_t_h. The height
will then be automatically generated, as will be the width
if you control the picture's heigth. Please note that -_w
overrides any -_h option!
Option -_r _r_o_t_a_t_i_o_n__a_n_g_l_e (_i_n _d_e_g_r_e_e_s) allows you to rotate
the object prior to all scaling operations. Its main use is
to facilitate landscape format: -r90 rotates your whole pic-
ture, e.g. from portait to landscape format. However, any
reasonable rotation angle is valid.
If you need to process a series of similar objects which
should be translated into exactly the same coordinate sys-
tem, there is a way to override the auto-scaling: First, run
all files separately and note the infos on the used coordi-
nate ranges. Then, pick a range that will cover ALL your
pictures. You can now assign defaults to the internally
generated range limits by specifying -_x _x_m_i_n, -_X _x_m_a_x, -_y
_y_m_i_n, and -_Y _y_m_a_x. NOTE: Clipping is NOT supported! If any
picture coordinate exceeds your limits, they will be
overwritten.
Use option -_m _m_o_d_e to select the program mode, i.e. the out-
put format. Currently supported: mode = "mf" (Metafont),
"ps" (PostScript), "pcl" (HP-PCL Level 3 format, suitable
Sun Release 4.1 Last change: 12 September 1991 2
hp2xx(1) USER COMMANDS hp2xx(1)
for printing on a HP Laserjet II, DeskJet, or compatible
printer), "atari" (ATARI screen format), or "pcx" (PC-
Paintbrush format, also accepted by MS-Paintbrush / Windows
3.0 and many other PC based pixel renderers). On PC's, there
also is a preview option "vga" which supports VGA cards
ONLY. Default mode is pcl.
If you use a raster format, the picture is rasterized by
default into a 75 DPI resolution image. Use option -_d
_D_P_I__v_a_l_u_e to change the resolution, e.g. -d300 will cause a
HP LJ-II compatible 300 dpi rasterization. There is a way of
specifying a different resolution for y direction: -_D
_D_P_I__y__v_a_l_u_e, although it is of limited use yet. It is
intended for, e.g., support of NEC P6 printers (360x180 DPI)
and alike in a later release.
If processing large pictures at high resolution on low-
memory machines, typically under DOS, the program may start
swapping. Opionally change the swap file by using -_s _s_w_a_p_-
_f_i_l_e, e.g. to speed up processing by swapping to a RAM disk.
VECTOR FORMATS
Currently, two vector formats are supported: _T_e_X/_M_e_t_a_f_o_n_t
and -I PostScript. Use -_m _m_f to convert a HPGL drawing into
a Metafont character to be included into a TeX document as
the character "Z" of a special font that you may create.
Edit the metafont source, e.g., to change the letter "Z" for
another, or to change the line thickness, which is set to
0.4pt by default. Use option -_p _p_e_n_s_i_z_e for a limited con-
trol over pensize: The actual Metafont pensize will be "pen-
size * 0.1 mm", with pensize = 1, 2, 3, or 4. The same
applies to -_m _p_s, the PostScript mode. Here, you also need
to use options -o and -O (see below) for proper margins in
paper since _h_p_2_x_x puts your picture "flush" to the left and
upper paper limit by default.
RASTER FORMATS
The following formats are supported: HP-PCL, PCX, ATARI, and
VGA (preview on PC's). However, generation of other formats
is made easy for programmers because of _h_p_2_x_x'_s modular
structure. The program allocates a bitmap on a line-by-line
basis, swapping lines to disk if needed, and plots into this
bitmap. Depending on the selected format, a conversion
module is then activated, which might easily be replaced by
other converters. Add more formats if you like!
Option -_p _p_e_n_s_i_z_e controls the size (in pixels) of the vir-
tual plotting pen. The only implemented shape of the pen tip
is a square of the given length. Default pen size is 1.
Specifying -p4 when in 75 DPI mode will make pretty clumsy
pictures, while you may prefer -p2 over -p1 when in 300 DPI.
Sun Release 4.1 Last change: 12 September 1991 3
hp2xx(1) USER COMMANDS hp2xx(1)
PCX: The size of a PCX picture is controlled via its speci-
fied height and the current DPI value. To create a high-
resolution PCX image, just increase the DPI value as
desired. PCX format does not accept offsets.
ATARI: ST screens (640x400 pixels) can easily be dumped to
files. Many programs accept graphics by including these
screen dump files. Graphics filling more than one screenful
may be split into screen-size blocks and loaded/mounted
blockwise. _h_p_2_x_x converts to ATARI screen format by trying
to fit the resulting picture into a single screen equivalent
(max. 400 rows, max. 80 Bytes (640 pixel) per row). If it
succeeds, _h_p_2_x_x produces a single output file. Specify ONLY
its base name (option -f), since _h_p_2_x_x adds the file exten-
sion ".000". However, if more screen blocks are required
horizontally and/or vertically, _h_p_2_x_x will automatically
split the picture into files with extensions ".001" / ".010"
to a maximum of ".999" in a matrix-like fashion: Extension
".rrc" indicates a block at row position rr and column posi-
tion c, counting from 0. The picture is padded with back-
ground color at its right and lower margins, if needed. File
compression is not supported yet. -- By setting DPI and
height/width, you implicitely have control over the result-
ing scan lines or columns. E.g., leaving DPI at its default
(-d 75), and specifying a height of 135mm (-h 135), you'll
get 400 rows.
PCL: HP-PCL Level 3 format, most useful for direct printer
output. Due to this action, there have been added some extra
flags and options: Use flag -_i to send a printer initializa-
tion sequence before the actual image. Flag -_F adds a Form
Feed (FF, hex 0C) after the image is completed, which is
what you may want most of the time. However, overlay print-
ing of several files is feasible by omitting -F.
For additional control of the picture's final position on
paper, you may add x or y offsets using -_o _X__o_f_f_s_e_t or -_O
_Y__o_f_f_s_e_t. _E._g., -_o _2_0 -_O and 20 mm additional left margin.
For DeskJet / DeskJet-plus / DeskJet 500 printers, there are
some special printer commands. Activate them with flag -_S.
EXAMPLES
% hp2xx -m pcx -f my_output.pcx -d300 -p2 -h50 -a 1.2 my_input.hp
creates a PCX file at 300 DPI of height 50 mm, using an
aspect factor of 1.2 and a pen size of 2 pixels.
% my_hpgl_generator | hp2xx -o20 -O30 -F -q | lpr -P my_PCL_printer
HPGL output is piped through hp2xx; the resulting PCL code
is piped to the printer queue, giving an image of height 100 mm
Sun Release 4.1 Last change: 12 September 1991 4
hp2xx(1) USER COMMANDS hp2xx(1)
at 75 DPI. An additional left margin of 20mm and upper margin
of 30mm is created. A formfeed will be added (handy if your
printer queue does not).
% hp2xx -m vga my_input.hp
(PC only): Preview on VGA screen.
AUTHOR
Heinz W. Werntges, Biokybernetik, Geb. 26.12, Heinrich-
Heine-Universitaet,
D-4000 Duesseldorf 1, Germany. Internet: heinz@biokyb.uni-
duesseldorf.de
DIAGNOSTICS
The number of ignored and/or unknown HPGL commands is given.
You will be informed if swapping starts. Progress is indi-
cated by output of dots, each dot representing 10 move/draw
commands during scanning and plotting, or 10 scan lines dur-
ing output. Shut off diagnostic output by specifying -_q
(quiet mode).
BUGS
There are many non-implemented HPGL commands. Only few test-
ing has been done for Postscript and ATARI formats, so be
prepared for bugs there, and PLEASE report them -- thank
you!
SEE ALSO
HPtoMF(1), D. Donath's HPGL-to-Metafont converter.
Sun Release 4.1 Last change: 12 September 1991 5